import request from '@/utils/request';
import type { IPageRequest, OrderState } from '@/typings/api';
import type { IOrder, IWechatOrder } from '@/typings/interface';
/**
 * 订单列表
 */

export function getOrders(data: IPageRequest & { state: OrderState | null }) {
  return request<IOrder, true>('/order/v1/list', {
    method: 'POST',
    data
  });
}

/**
 * 微信支付
 */
export function wxPay(req: { id: number; type: string }) {
  return request<IWechatOrder>('/order/v1/pay', {
    method: 'POST',
    data: req
  });
}
